1. Field of the Invention
The present invention relates to a computer program product, system, and method for considering a density of tracks to destage in groups of tracks to select groups of tracks to destage.
2. Description of the Related Art
A cache management system buffers tracks in a storage device recently accessed as a result of read and write operations in a faster access storage device, such as memory, than the storage device storing the requested tracks. Subsequent read requests to tracks in the faster access cache memory are returned at a faster rate than returning the requested tracks from the slower access storage, thus reducing read latency. The cache management system may also return complete to a write request when the modified track directed to the storage device is written to the cache memory and before the modified track is written out to the storage device, such as a hard disk drive. The write latency to the storage device is typically significantly longer than the latency to write to a cache memory. Thus, using cache also reduces write latency.
Current destaging techniques, known as Intelligent Write Caching (IWC) or Wise Order Writing (WOW), select tracks to destage based on both a temporality or time the track has been in cache, with an algorithm known as CLOCK, and based on the spatial location of the track, with an algorithm known as CSCAN. CLOCK is a Least Recently Used (LRU) based algorithm which demotes tracks that have been in the cache the longest, i.e., least recently used. To obtain CLOCK properties, the IWC maintains a temporal bit per track. The temporal bit gets set when the host writes a track. The temporal bit gets reset when a destage scan comes across a track with temporal bit set. If the destage scan finds a stride in a Redundant Array of Independent Disks (RAID) array with no tracks having the temporal bit set, than the destage scan can select that stride for destage. The CSCAN operation destages tracks based on spatial location. To obtain CSCAN properties, the IWC maintains a sorted list of modified tracks using a balanced tree (B-tree). The destage scan traverses the balanced tree to look for tracks at the nodes of the balanced tree to destage, where the balanced tree organizes tracks based on an order of track location from lowest to highest address.
There is a need in the art for improved techniques for destaging tracks in cache to storage.